Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

docs: warn that useState should only contain JSON-serializable content #5994

Merged
merged 6 commits into from
Jul 21, 2022

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Jul 19, 2022

πŸ”— Linked issue

resolves nuxt/nuxt#14326.

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Adds a brief warning about serializable content in useState. I haven't added similar warnings to data fetching composables as this is less likely to be an issue given that is originally coming over the wire as JSON, most likely, but I may change my mind, and happy to be convinced otherwise.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added the documentation Improvements or additions to documentation label Jul 19, 2022
@danielroe danielroe requested a review from pi0 July 19, 2022 13:46
@danielroe danielroe self-assigned this Jul 19, 2022
@netlify
Copy link

netlify bot commented Jul 19, 2022

βœ… Deploy Preview for nuxt3-docs ready!

Name Link
πŸ”¨ Latest commit b834be2
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62d91449d01449000844138a
😎 Deploy Preview https://deploy-preview-5994--nuxt3-docs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@pi0
Copy link
Member

pi0 commented Jul 21, 2022

@danielroe Do you mind to simplify the explanation to be similar to the guide page? #5994 (comment)

@pi0 pi0 merged commit d77b62d into main Jul 21, 2022
@pi0 pi0 deleted the docs/state-warning branch July 21, 2022 08:56
@pi0 pi0 mentioned this pull request Aug 5, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useState array of objects can't access functions
4 participants